package handle.imp;

import com.melloware.jintellitype.JIntellitype;
import handle.HotKeyRegistrant;

/**
 * @description:
 * @author: ziger
 * @time: 2022/9/9 17:00
 */
public class DefaultHotKeyRegistrant implements HotKeyRegistrant {

    private static final int SHIFT_A = 88;
    private static final int SHIFT_D = 89;
    private static final int SHIFT_W = 90;
    private static final int SHIFT_S = 91;

    @Override
    public void register() {
        JIntellitype.getInstance().registerHotKey(SHIFT_A, JIntellitype.MOD_SHIFT, 'A');
        JIntellitype.getInstance().registerHotKey(SHIFT_D, JIntellitype.MOD_SHIFT, 'D');
        JIntellitype.getInstance().registerHotKey(SHIFT_W, JIntellitype.MOD_SHIFT, 'W');
        JIntellitype.getInstance().registerHotKey(SHIFT_S, JIntellitype.MOD_SHIFT, 'S');
    }

    @Override
    public void unRegister() {
        JIntellitype.getInstance().unregisterHotKey(SHIFT_A);
        JIntellitype.getInstance().unregisterHotKey(SHIFT_D);
        JIntellitype.getInstance().unregisterHotKey(SHIFT_W);
        JIntellitype.getInstance().unregisterHotKey(SHIFT_S);
    }
}
